import { Component, OnInit, ElementRef, Input, HostBinding } from '@angular/core';
import { isNumber } from '../../../util';

@Component({
  selector: 'bz-view-panel',
  templateUrl: './view-panel.component.html'
})
export class ViewPanelComponent implements OnInit {

  @Input() set bzMaxWidth(maxWidth: number) {
    if (isNumber(maxWidth)) {
      this.bzCenter = true;
      this._maxWidth = maxWidth;
    } else {
      this.bzCenter = false;
      this._maxWidth = undefined;
    }
  }

  @Input() @HostBinding('class.ghost') bzGhost = false;
  @HostBinding('class.center') bzCenter = false;
  @HostBinding('style.max-width.px') _maxWidth: number;

  constructor(public ele: ElementRef) { }

  ngOnInit() {
  }

}
